#!/bin/sh
#USERS_AT_HOSTS="lliurex@oogie.lliurex.fs lliurex@lliurex.net"

USERS_AT_FTP="lliurex@arxiu.lliurex.net"
WIKIFILE=$(mktemp /home/lliurex/wikifile.XXXX)

for uaf in $USERS_AT_FTP; do 
	echo "Copiando archivos a $uaf "
	echo ""
	if  [ -r "$HOME/.ssh/$uaf.key" ]; then
		RSYNC_RSH="ssh -i $HOME/.ssh/$uaf.key"
	else
		RSYNC_RSH="ssh"
	fi
	export $RSYNC_RSH
	/usr/bin/rsync -av --delete /srv/nfs/lliurex1206/llx1206/ $uaf:/srv/ftp/anonymous/lliurex/pro-nemo
	echo "Todo ha ido bien"
done

echo "Preparing wiki notice"
cat $WIKIFILE | grep ".deb" | sed -e "s%.*\/%%g;s%\_all.deb%%g;s%\_i386.deb%%g;s%'%%g;s%\_% \(\_%g;s%$%\_\)%g;s%^% \* %g"


